-function() {
	var d = document, isStrict = d.compatMode == "CSS1Compat", dd = d.documentElement, db = d.body, m = Math.max, ie = !!d.all, ua = navigator.userAgent
			.toLowerCase(), head = d.getElementsByTagName('head')[0], getWH = function() {
		return {
			h : (isStrict ? dd : db).clientHeight,
			w : (isStrict ? dd : db).clientWidth
		}
	}, getS = function() {
		return {
			t : m(dd.scrollTop, db.scrollTop),
			l : m(dd.scrollLeft, db.scrollLeft)
		}
	}, getP = function(o) {
		var l, t;
		if (o.getBoundingClientRect) {
			var p = getS();
			var el = o.getBoundingClientRect();
			l = p.l + el.left;
			t = p.t + el.top;
		} else {
			l = o.offsetLeft;
			t = o.offsetTop;
			while (o = o.offsetParent) {
				l += o.offsetLeft;
				t += o.offsetTop;
			}
		}
		return {
			x : l,
			y : t
		};
	}, creElm = function(o, t, a) {
		var b = d.createElement(t || 'div');
		for ( var p in o) {
			p == 'style' ? b[p].cssText = o[p] : b[p] = o[p]
		}
		return (a || db).insertBefore(b, (a || db).firstChild)
	}, div = creElm( {
		style : "position:absolute;z-index:1000000000;display:none;overflow:auto;"
	}), div1 = creElm( {
		style : "position:fixed;z-index:1000000000;display:none;top:50%;left:50%;overflow:auto;"
	}), iframe = creElm(
			{
				style : 'position:' + (/firefox/.test(ua) ? 'fixed'
						: 'absolute') + ';display:none;filter:alpha(opacity=0);opacity:0',
				frameBorder : 0
			}, 'iframe'), timer, inputTimer, list, clist, h, texts = {}, clickpopjs;
	creElm( {
		href : 'css/css1.css',
		rel : 'stylesheet',
		type : 'text/css'
	}, 'link');
	sharetoBtnContain = {
		pop : div,
		centerpop : div1,
		disappear : function(b) {
			var c = window.event || b, t = c.srcElement || c.target, contain = div1.contains ? div1
					.contains(t)
					: !!(div1.compareDocumentPosition(t) & 16), contain1 = div.contains ? div
					.contains(t)
					: !!(div.compareDocumentPosition(t) & 16);
			if (!contain && !contain1
					&& t.className.indexOf('shareto_button_compact') == -1
					&& t.parentNode.className != 'shareto_button') {
				iframe.style.display = div1.style.display = 'none'
			}
		},
		over : function(e) {
			var c = window.event || e, target = c.srcElement || c.target, T = this, timerCont, fn = function() {
				timerCont = setInterval(function() {
					if (div.innerHTML) {
						var p = getP(target), wh = getWH(), tl = getS();
						with (div.style) {
							display = "block";
							var a = T.style.display;
							T.style.display = 'block';
							top = p.y + target.offsetHeight + 'px';
							left = p.x + 'px';
							T.style.display = a;
						}
						;
						with (iframe.style) {
							top = div.offsetTop + 'px';
							left = div.offsetLeft + 'px';
							width = div.offsetWidth + 'px';
							height = div.offsetHeight + 'px';
							margin = "";
							display = 'block'
						}
						;
						clearInterval(timerCont)
					}
				}, 50)
			};
			if (!clickpopjs) {
				clickpopjs = creElm( {
					src : 'sjs/shareto_button_menu.js',
					charset : 'utf-8'
				}, 'script', head);
				clickpopjs.onloaded = 0;
				clickpopjs.onload = function() {
					clickpopjs.onloaded = 1;
					fn()
				};
				clickpopjs.onreadystatechange = function() {
					/complete|loaded/.test(clickpopjs.readyState)
							&& !clickpopjs.onloaded && fn()
				}
			} else {
				fn()
			}
			return false
		},
		out : function() {
			timer = setTimeout(function() {
				div.style.display = 'none';
				div1.style.display != 'block'
						&& (iframe.style.display = 'none')
			}, 100)
		},
		move : function() {
			clearTimeout(timer)
		},
		center : function() {
			if (!this.script) {
				this.script = creElm( {
					src : 'sjs/shareto_button_window.js',
					charset : 'utf-8'
				}, 'script', head);
				db.style.position = 'static'
			} else {
				var a = getS();
				div1.style.display = "block";
				div1.style.margin = (-div1.offsetHeight / 2 + a.t) + "px "
						+ (-div1.offsetWidth / 2 + a.l) + "px";
				list = d.getElementById('ckelist'), clist = list
						.cloneNode(true), h = clist
						.getElementsByTagName('input');
				for ( var i = 0, ci; ci = h[i++];) {
					texts[ci.value] = ci.parentNode
				}
				;
				with (iframe.style) {
					left = top = '50%';
					width = div1.offsetWidth + 'px';
					height = div1.offsetHeight + 'px';
					margin = div1.style.margin;
					display = 'block'
				}
			}
			;
			return false;
		},
		choose : function(o) {
			clearTimeout(inputTimer);
			inputTimer = setTimeout(function() {
				var s = o.value.replace(/^\s+|\s+$/, ''), frag = d
						.createDocumentFragment();
				for ( var p in texts) {
					eval("var f = /" + (s || '.') + "/ig.test(p)");
					f && frag.appendChild(texts[p].cloneNode(true))
				}
				list.innerHTML = '';
				list.appendChild(frag)
			}, 100)
		},
		centerClose : function() {
			iframe.style.display = div1.style.display = 'none'
		}
	};
	var h = d.getElementsByTagName('a');
	for ( var i = 0, ci, tmp; ci = h[i++];) {
		if (/\bshareto_button\b/.test(ci.className)) {
			ci.onmouseout = sharetoBtnContain.out;
			ci.onmousemove = sharetoBtnContain.move;
			ci.onclick = sharetoBtnContain.center;
			ci.onmouseover = sharetoBtnContain.over;
			ci.hideFocus = true;
			continue
		}
		;
		if (/\bshareto_button_compact\b/.test(ci.className)) {
			ci.className = 'shareto_button_compact st_button stico stico_shareto';
			ci.onmouseout = sharetoBtnContain.out;
			ci.onmousemove = sharetoBtnContain.move;
			ci.onclick = sharetoBtnContain.center;
			ci.onmouseover = sharetoBtnContain.over;
			ci.hideFocus = true;
			continue
		}
		;
		if (ci.className
				&& (tmp = ci.className.match(/^shareto_button_(\w+)$/))
				&& tmp[1]) {
			ci.innerHTML = '<span class="stico st_button stico_' + tmp[1] + '"></span>';
			ci.onclick = function(a) {
				return function() {
					share_to(a)
				}
			}(tmp[1]);
			ci.href = 'javascript:void(0);';
			ci.title = '分享到' + tmp[1]
		}
	}
	;
	div.onmouseover = function() {
		clearTimeout(timer)
	};
	div.onmouseout = function() {
		sharetoBtnContain.out()
	};
	ie ? d.attachEvent("onclick", sharetoBtnContain.disappear) : d.addEventListener("click",
			sharetoBtnContain.disappear, false);
}();